<?php

namespace app\apiadmin\model\behavior;

use app\apiadmin\model\mongoModel;

class LiveOnlineUserStatisticsMongo extends mongoModel
{

    protected $collection = 'live_online_user_statistics_';

    protected $pk = '_id';

    public function __construct($id) {
        $this->collection = $this->collection.$id;
        parent::__construct();
    }

    public static function list($liveId)
    {
        $model = new static($liveId);
        // return $model->options([ 'sort' => ['_id' => 1]])->select();
        return $model->groupSumList('statistics_time','online_user_nums');
    }
}